<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        ul li {

            list-style: none;
        }
        a{
            text-decoration: none;
        }
        .nav {
            width: 500px;
            margin: 100px auto;
        }
        .nav>li {
            float: left;
            width: 80px;
            
        }
        .nav>li>a{
            display: block;
            width: 100%;
            height: 40px;
            line-height: 40px;
            color: #333;
            text-align: center;
        }
        .nav>li>a:hover{
            background-color: #ccc;
        }
        .nav ul {
            display: none;
            box-sizing: border-box;
                width: 100%;
                border-left: 1px solid orange;
                border-right: 1px solid orange;
        }   
        .nav ul li {

            height: 40px;
            border-bottom: 1px solid orange;
            line-height: 40px;
            text-align: center;
        }  
        .nav ul li:hover{
            background-color: orange;
        }
        
    </style>
</head>
<body>
    <ul class="nav">
        <li>
            <a href="#">微博</a>
            <ul>
                <li>私信</li>
                <li>评论</li>
                <li>@我</li>
            </ul>
        </li>
        <li>
            <a href="#">微博</a>
            <ul>
                <li>私信</li>
                <li>评论</li>
                <li>@我</li>
            </ul>
        </li>
        <li>
            <a href="#">微博</a>
            <ul>
                <li>私信</li>
                <li>评论</li>
                <li>@我</li>
            </ul>
        </li>
        
    </ul>
    <script>
   var nav  = document.querySelector('.nav')
  var lis =  nav.children
      for(var i = 0;i<lis.length;i++){
          lis[i].onmouseover = function(){
              this.children[1].style.display = 'block'
          }
          lis[i].onmouseout = function(){
            this.children[1].style.display = 'none'
          }
      }
    </script>
</body>
</html>